package com.xiaoxi.decoratormode.display;

import java.util.List;

/**
 * @Author xiaoxi
 * @ProjectName design_mode
 * @PackageName com.xiaoxi.decoratormode.display
 * @ClassName MultDisplay
 * @Description TODO
 * @Date 2023/3/14 17:00
 * @Version 1.0
 */
public class MultipleDisplay extends Display {

    private List<String> string;
    private int rows;

    public MultipleDisplay(List<String> string) {
        this.string = string;
        this.rows = string.size();
    }

    @Override
    public int getColumns() {
        return 0;
    }

    @Override
    public int getRows() {
        return this.rows;
    }

    @Override
    public String getRowText(int row) {
        if(row > getRows()) {
            return "";
        }
        return string.get(row);
    }

}
